package com.hancher.common.rv;

import android.view.View;

import androidx.recyclerview.widget.RecyclerView;
import androidx.viewbinding.ViewBinding;

import lombok.Getter;

/**
 * 描述 :  <br/>
 * 时间 : 2023/11/23 19:40 <br/>
 * 作者 : Hancher ytu_shaoweijie@163.com
 */
@Getter
public class BaseVBViewHolder<VB extends ViewBinding> extends RecyclerView.ViewHolder {

    VB binding;

    public BaseVBViewHolder(VB viewBinding) {
        super(viewBinding.getRoot());
        binding = viewBinding;
    }

    public void setGone(View view, boolean visible) {
        view.setVisibility(visible ? View.VISIBLE : View.GONE);
    }

    public void setVisible(View view, boolean visible) {
        view.setVisibility(visible ? View.VISIBLE : View.INVISIBLE);
    }
}
